package org.liveboardgames.agricola.model.enums
{
    import mx.collections.ArrayCollection;
    import mx.collections.ListCollectionView;
    
    import org.liveboardgames.common.dictionary.collections.HashCollection;
    
    public class ResourceTypeEnum
    {
        public static const CLAY:String = "CLAY";
        
        public static const WOOD:String = "WOOD";
        
        public static const STONE:String = "STONE";
        
        public static const REED:String = "REED";
        
        public static const CHOICE_RESOURCE:String = "CHOICE_RESOURCE";
        
        public static const SHEEP:String = "SHEEP";
        
        public static const BOAR:String = "BOAR";
        
        public static const CATTLE:String = "CATTLE";
        
        public static const FOOD:String = "FOOD";
        
        public static const GRAIN:String = "GRAIN";
        
        public static const VEGETABLE:String = "VEGETABLE";
        
        public static const VALUES:ListCollectionView = getValues();
        
        public static const ANIMALS:ListCollectionView = getAnimals();
        
        public static const NON_ANIMALS:ListCollectionView = getNonAnimals();
        
        public static const FEED_RESOURCES:ListCollectionView = getFood();
        
        public static function getResourceAsMap(resourceType:String, quantity:int):HashCollection
        {
            var resourceAsMap:HashCollection = null;
            
            if (resourceType != null)
            {
                resourceAsMap = new HashCollection();
                resourceAsMap.put(resourceType, quantity);
            }
            
            return resourceAsMap;
        }
        
        private static function getValues():ListCollectionView
        {
        	var list:ListCollectionView = new ArrayCollection();
        	
        	list.addItem(SHEEP);
            list.addItem(BOAR);
            list.addItem(CATTLE);
            list.addItem(WOOD);
            list.addItem(CLAY);
            list.addItem(REED);
            list.addItem(STONE);
            list.addItem(GRAIN);
            list.addItem(VEGETABLE);
            list.addItem(FOOD);
        	
        	return list;
        }
        
        private static function getAnimals():ListCollectionView
        {
            var list:ArrayCollection = new ArrayCollection();
            
            list.addItem(SHEEP);
            list.addItem(BOAR);
            list.addItem(CATTLE);
            
            return list;
        }
        
        private static function getNonAnimals():ListCollectionView
        {
            var list:ArrayCollection = new ArrayCollection();
            
            list.addItem(WOOD);
            list.addItem(CLAY);
            list.addItem(REED);
            list.addItem(STONE);
            list.addItem(GRAIN);
            list.addItem(VEGETABLE);
            list.addItem(FOOD);
            
            return list;
        }
        
        private static function getFood():ListCollectionView
        {
            var list:ArrayCollection = new ArrayCollection();
            
            list.addItem(GRAIN);
            list.addItem(VEGETABLE);
            list.addItem(FOOD);
            
            return list;
        }
    }
}